package com.cq.hd.system.controller;

import com.cq.hd.common.response.Result;
import com.cq.hd.common.response.ResultGenerator;
import com.cq.hd.system.api.OssApi;
import com.cq.hd.system.config.OssConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class OssController implements OssApi {

    @Autowired
    private OssConfig ossConfig;

    @Override
    public Result<String> uploadFile(MultipartFile file, String uploadPath, String fileName) {
        return ResultGenerator.success(ossConfig.uploadFile(file, uploadPath, fileName));
    }

}
